home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re streams & sinks < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.3 KB  |  [TEXT/ttxt]

  1. Subject:     Re: streams & sinks
  2. Sent:        6/11/96 9:02 AM
  3. Received:    6/11/96 9:12 AM
  4. From:        Kirk Swenson, kswenson@mail.keypress.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8.                       RE>streams & sinks                           6/11/96
  9.  
  10. >I am trying to update my source to R1, and when I try to compile a 
  11. >line constructing a FW_CWritableStream, I get an error because
  12. FW_CWritableStream, 
  13. >takes a FW_OSink, and all the sink classes descend from 
  14. >FW_PRandomAccessSink. Where have I gone wrong here? (BTW, I am using 
  15. >code from the CD).
  16.  
  17. FW_PRandomAccessSink has a conversion operator to FW_ORandomAccessSink
  18. defined by its base class, FW_TSOMPtr.  The following code works for me to
  19. create a FW_CReadableStream.  Something analogous should work for creating a
  20. FW_CWritableStream.
  21.  
  22. void
  23. ImportFromFile( FW_OFileSpecification*        iFileSpec)
  24. {
  25.     FW_SOMEnvironment            ev;
  26.  
  27.     // Create the FW_PFile from the specification
  28.     FW_PFile                    tImportFile( ev, iFileSpec);
  29.  
  30.     // Create the sink
  31.     FW_PFileSink                tFileSink( ev, tImportFile);
  32.  
  33.     // Create the stream
  34.     FW_CReadableStream            tReadStream( tFileSink);
  35. }
  36.  
  37. Kirk Swenson
  38. Senior Software Engineer
  39. Key Curriculum Press
  40. kswenson@keypress.com
  41.  
  42.